#!/bin/bash

export JAVA_HOME=/usr/java/jdk1.6.0_13
export PATH=$JAVA_HOME/bin:$PATH

echo "Daily Build Results..."
echo "Compiling project..."
$3android update project -n FIRBI -p $1 -t 3
$4ant debug -file $1build.xml
echo "Compiling test..."
$3android update project -n FIRBI_Tests -p $1tests -t 3
$4ant debug -f $1tests/build.xml
echo "Running test..."
$3emulator -avd $2 &
sleep 120
$3adb install -r $1bin/FIRBI-debug.apk
$3adb install -r $1tests/bin/FIRBI_Tests-debug.apk
$3adb shell am instrument -w  firbi.base.tests/android.test.InstrumentationTestRunner
